﻿using AfrikDotnetWebSite.Models;
using System.Linq;
using System.Web.Mvc;

namespace AfrikDotnetWebSite.Controllers
{
    public class EventsController : Controller
    {
        AfrikDotnetContext db = new AfrikDotnetContext();

        protected override void Dispose(bool disposing)
        {
            db.Dispose();
            base.Dispose(disposing);
        }

        public ActionResult Index()
        {
            var siteSettings = db.SiteSettings;
            ViewBag.EventsLink = siteSettings.Where(s => s.Key.ToLower() == "events").Select(s => s.Value).FirstOrDefault();

            return View();
        }

    }
}
